<?php

require_once(dirname(__FILE__)."/../../tests/test_helper.php");
require_once(dirname(__FILE__).'/../helper.php');
require_once(dirname(__FILE__).'/../../libs/inflector.php');

class HelperTest extends UnitTestCase {
  function testTextField(){
  	$form = array();
  	$form = Helper::addTextField($form,'user','name');
  	$this->assertTrue(sizeof($form) > 0);
  	$this->assertEqual(
  		$form['user[name]'],
  		array (
		  '#type' => 'textfield',
		  '#title' => 'Name',
		  '#default_value' => '',
		  '#size' => 60,
		  '#maxlength' => 64,
  		  '#suffix' => "<br class=\"clear\"\\>"
		),
  		"check settings for field ".var_export($form,true)
  	);
  }
  function testHiddenField(){
  	$form = Helper::addHiddenField(array(),'user','id');
  	$this->assertEqual(
  		$form['user[id]'],
  		array (
		  '#type' => 'hiddenfield',
		  '#default_value' => ''
		),
  		"check settings for field ".var_export($form,true)
  	);
  }
}

?>